import NavBar from '@/components/menus/NavBar';
import EditList from '@/components/user/EditList';
import { View } from '@tarojs/components';
import Taro from '@tarojs/taro';

export default () => {
  const router = url => Taro.navigateTo({ url });
  const userOpt = [
    {
      label: '账号资料',
      rightHandler() {
        router('/pages/my/userinfo');
      },
    },
    {
      label: '账号安全中心',
      rightHandler() {
        router('/pages/my/security');
      },
    },
  ];
  const videoOpt = [
    {
      label: '播放设置',
      rightHandler() {},
    },
    {
      label: '开屏画面设置',
      rightHandler() {},
    },
  ];
  const msgOpt = [
    {
      label: '推送设置',
      rightHandler() {},
    },
    {
      label: '消息设置',
      rightHandler() {},
    },
    {
      label: '其他设置',
      rightHandler() {},
    },
  ];
  const otherOpt = [
    {
      label: '我的客服',
      rightHandler() {},
    },
    {
      label: '商务合作',
      rightHandler() {},
    },
    {
      label: '用户协议',
      rightHandler() {},
    },
    {
      label: '隐私政策',
      rightHandler() {},
    },
    {
      label: '隐私权限设置',
      rightHandler() {},
    },
  ];
  return (
    <NavBar title="设置中心">
      <View>
        <View className="grid grid-cols-1 gap-6">
          <EditList options={userOpt} />
          <EditList options={videoOpt} />
          <EditList options={msgOpt} />
          <EditList options={otherOpt} />
        </View>
      </View>
    </NavBar>
  );
};
